package com.ruoyi.zyx.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.zyx.mapper.ZyxOrderBillMapper;
import com.ruoyi.zyx.domain.ZyxOrderBill;
import com.ruoyi.zyx.service.IZyxOrderBillService;

/**
 * 回单Service业务层处理
 *
 * @author ruoyi
 * @date 2021-06-17
 */
@Service
public class ZyxOrderBillServiceImpl implements IZyxOrderBillService
{
    @Autowired
    private ZyxOrderBillMapper zyxOrderBillMapper;

    /**
     * 查询回单
     *
     * @param id 回单ID
     * @return 回单
     */
    @Override
    public ZyxOrderBill selectZyxOrderBillById(Long id)
    {
        return zyxOrderBillMapper.selectZyxOrderBillById(id);
    }

    @Override
    public ZyxOrderBill getInfoBySendorderid(Long sendorderid) {
        return zyxOrderBillMapper.getInfoBySendorderid(sendorderid);
    }

    /**
     * 查询回单列表
     *
     * @param zyxOrderBill 回单
     * @return 回单
     */
    @Override
    public List<ZyxOrderBill> selectZyxOrderBillList(ZyxOrderBill zyxOrderBill)
    {
        return zyxOrderBillMapper.selectZyxOrderBillList(zyxOrderBill);
    }

    /**
     * 新增回单
     *
     * @param zyxOrderBill 回单
     * @return 结果
     */
    @Override
    public int insertZyxOrderBill(ZyxOrderBill zyxOrderBill)
    {
        zyxOrderBill.setCreateTime(DateUtils.getNowDate());
        return zyxOrderBillMapper.insertZyxOrderBill(zyxOrderBill);
    }

    /**
     * 修改回单
     *
     * @param zyxOrderBill 回单
     * @return 结果
     */
    @Override
    public int updateZyxOrderBill(ZyxOrderBill zyxOrderBill)
    {
        zyxOrderBill.setUpdateTime(DateUtils.getNowDate());
        return zyxOrderBillMapper.updateZyxOrderBill(zyxOrderBill);
    }

    /**
     * 批量删除回单
     *
     * @param ids 需要删除的回单ID
     * @return 结果
     */
    @Override
    public int deleteZyxOrderBillByIds(Long[] ids)
    {
        return zyxOrderBillMapper.deleteZyxOrderBillByIds(ids);
    }

    /**
     * 删除回单信息
     *
     * @param id 回单ID
     * @return 结果
     */
    @Override
    public int deleteZyxOrderBillById(Long id)
    {
        return zyxOrderBillMapper.deleteZyxOrderBillById(id);
    }
}
